import request from "../utils/request";
const api = {
  getUsers: "/users",
  createUser: "/users",
  editUser(id) {
    return `/users/${id}`;
  },
  deleteUser(id) {
    return `/users/${id}`;
  },
};

export const getUsers = (params = {}) => {
  return request({ url: api.getUsers, method: "get", params });
};

export const deleteUser = (id) => {
  return request({ url: api.deleteUser(id), method: "delete" });
};

export const createUser = (data) => {
  return request({ url: api.createUser, method: "post", data });
};

export const editUser = (data) => {
  return request({ url: api.editUser(data.id), method: "put", data });
};
